/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.testis.gui.mvc.controller;

import org.testis.gui.mvc.controller.testbed.*;
import java.awt.Frame;

/**
 *
 * @author selcuk
 */
public class TestBedControllerList {

    private static TestBedControllerList m_reference;
    private Frame m_parentFrame;
    private TbedTreeController m_treeController;
    private TbedPopupController m_popupController;
    private DeviceDefinitionController m_deviceDefinitionController;
    private DeviceFirmwareController m_deviceFirmwareController;
    private TestPcController m_testPcController;
    private DeviceGroupController m_deviceGroupController;
    private DeviceGroupDetailController m_deviceGroupDetailController;
    private DutController m_dutController;
    private NetworkAdapterController m_networkAdapterController;
    private SerialConfigController m_serialConfigController;
    private DirectSerialConfigController m_direcSerialConfigController;
    private NetworkSerialConfigController m_networkSerialConfigController;

    private TestBedControllerList() {
    }

    public static TestBedControllerList newInstance() {
        if (m_reference == null) {
            m_reference = new TestBedControllerList();
        }
        return m_reference;
    }

    public static TestBedControllerList newInstance(Frame parentFrame) {
        if (m_reference == null) {
            m_reference = new TestBedControllerList();
        }
        m_reference.setParentFrame(parentFrame);
        return m_reference;
    }

    public Frame getParentFrame() {
        return m_parentFrame;
    }

    public void setParentFrame(Frame frame) {
        m_parentFrame = frame;
    }

    public TbedTreeController getTbedTreeController() {
        if (m_treeController == null) {
            setTbedTreeController(new TbedTreeController());
        }
        return m_treeController;
    }

    public void setTbedTreeController(TbedTreeController val) {
        m_treeController = val;
    }

    /**
     * @return the m_popupController
     */
    public TbedPopupController getPopupController() {
        if (m_popupController == null) {
            setPopupController(new TbedPopupController());
        }
        return m_popupController;
    }

    /**
     * @param m_popupController the m_popupController to set
     */
    public void setPopupController(TbedPopupController controller) {
        m_popupController = controller;
    }

    public DeviceDefinitionController getDeviceDefinitionController() {
        if (m_deviceDefinitionController == null) {
            setDeviceDefinitionController(new DeviceDefinitionController());
        }
        return m_deviceDefinitionController;
    }

    /**
     * @param m_deviceDefinitionController the m_deviceDefinitionController to set
     */
    public void setDeviceDefinitionController(DeviceDefinitionController controller) {
        this.m_deviceDefinitionController = controller;
    }

    public DeviceFirmwareController getDeviceFirmwareController() {
        if (m_deviceFirmwareController == null) {
            setDeviceDefinitionController(new DeviceFirmwareController());
        }
        return m_deviceFirmwareController;
    }

    private void setDeviceDefinitionController(DeviceFirmwareController controller) {
        this.m_deviceFirmwareController = controller;
    }

    public TestPcController getTestPcController() {
        if (m_testPcController == null) {
            setTestPcController(new TestPcController());
        }
        return m_testPcController;
    }

    private void setTestPcController(TestPcController controller) {
        this.m_testPcController = controller;
    }

    public DeviceGroupController getDeviceGroupController() {
        if (m_deviceGroupController == null) {
            setDeviceGroupController(new DeviceGroupController());
        }
        return m_deviceGroupController;
    }

    public void setDeviceGroupController(DeviceGroupController controller) {
        m_deviceGroupController = controller;
    }

    public DeviceGroupDetailController getDeviceGroupDetailController() {
        if (m_deviceGroupDetailController == null) {
            setDeviceGroupDetailController(new DeviceGroupDetailController());
        }
        return m_deviceGroupDetailController;
    }

    public void setDeviceGroupDetailController(DeviceGroupDetailController controller) {
        m_deviceGroupDetailController = controller;
    }

    public DutController getDutController() {
        if (m_dutController == null) {
            setDutController(new DutController());
        }
        return m_dutController;
    }

    public void setDutController(DutController controller) {
        m_dutController = controller;
    }

    public NetworkAdapterController getNetworkAdapterController() {
        if (m_networkAdapterController == null) {
            setNetworkAdapterController(new NetworkAdapterController());
        }
        return m_networkAdapterController;
    }

    public void setNetworkAdapterController(NetworkAdapterController controller) {
        m_networkAdapterController = controller;
    }

    public SerialConfigController getSerialConfigController() {
        if (m_serialConfigController == null) {
            setSerialConfigController(new SerialConfigController());
        }
        return m_serialConfigController;
    }

    public void setSerialConfigController(SerialConfigController controller) {
        m_serialConfigController = controller;
    }

    public DirectSerialConfigController getDirectSerialConfigController() {
        if (m_direcSerialConfigController == null) {
            setDirectSerialConfigController(new DirectSerialConfigController());
        }
        return m_direcSerialConfigController;
    }

    public void setDirectSerialConfigController(DirectSerialConfigController controller) {
        m_direcSerialConfigController = controller;
    }

    public NetworkSerialConfigController getNetworkSerialConfigController() {
        if (m_networkSerialConfigController == null) {
            setNetworkSerialConfigController(new NetworkSerialConfigController());
        }
        return m_networkSerialConfigController;
    }

    public void setNetworkSerialConfigController(NetworkSerialConfigController controller) {
        m_networkSerialConfigController = controller;
    }
}
